package fr.generali.accueilclient.gwt.client.ui.components.table;

import com.google.gwt.user.cellview.client.Column;

public class ColumnDescription {

    private final Column< ? , ? > column;

    private final String name;

    private final String styleName;

    private final String width;

    public ColumnDescription(String name, String width, String styleName, Column< ? , ? > column) {
        this.name = name;
        this.width = width;
        this.styleName = styleName;
        this.column = column;
    }

    public ColumnDescription(String name, String width, Column< ? , ? > column) {
        this(name, width, null, column);
    }

    public ColumnDescription(String name, Column< ? , ? > column) {
        this(name, null, column);
    }

    public String getName() {
        return name;
    }

    @SuppressWarnings("unchecked")
    public <T> Column<T, ? > getColumn() {
        return (Column<T, ? > ) column;
    }

    public String getWidth() {
        return width;
    }

    public String getStyleName() {
        return styleName;
    }
}
